package main

import (
	"fmt"
	"strconv"
)

func thousandSeparator(n int) string {
	str := strconv.Itoa(n)
	nlen := len(str)
	if nlen < 4 {
		return str
	}

	for i := len(str) - 3; i > 0; i -= 3 {
		str = str[:i] + "." + str[i:]
	}
	return str
}

func main() {
	fmt.Println(thousandSeparator(1234))
	fmt.Println(thousandSeparator(123))
}
